home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / extmath.zip / EXTDUP.S < prev    next >
Text File  |  1993-01-06  |  834b  |  44 lines

  1. ; Copy 64-bit number
  2. ;
  3. ; Tim Victor, January 5, 1993
  4. ;
  5. ; Callable from C as follows:
  6. ; int ExtDup(src, dest);
  7. ;   always return 0
  8. ;
  9.  
  10.         .model  small
  11.         .code
  12.         public _ExtDup
  13. _ExtDup proc near
  14.  
  15.         push bp         ; save caller's stack frame
  16.         mov  bp,sp      ; address stack frame of this call
  17.         push si
  18.         push di
  19.  
  20. ; simple 4-word copy - don't bother w/ string ops
  21.         mov  si,[bp+4]  ; source address
  22.         mov  di,[bp+6]  ; dest address
  23.  
  24.         mov  ax,[si]
  25.         mov  [di],ax
  26.         mov  ax,[si+2]
  27.         mov  [di+2],ax
  28.         mov  ax,[si+4]
  29.         mov  [di+4],ax
  30.         mov  ax,[si+6]
  31.         mov  [di+6],ax
  32.  
  33.         sub  ax,ax      ; return 0
  34.  
  35.         pop  di
  36.         pop  si
  37.         pop  bp
  38.  
  39.         ret
  40.  
  41. _ExtDup endp
  42.         end
  43.  
  44.